<template>
  <PreviewpdfH5 ref="PreviewpdfH5"></PreviewpdfH5>
</template>

<script>
import {eventBus} from "../../../assets/Bus";
import PreviewpdfH5 from "./Pdf.vue";
export default {
  name: "DocFullScreen",
  components: {
    PreviewpdfH5
  },
  data() {
    return {
      pdfSrc: "", // pdf文件地址this.$route.query.url
      id: "", //报告id
    }
  },
  methods: {
  },
  created() {
    eventBus.$on("showDocFullScreen", params => {
      console.log("full接收"+params)
      //生产路径
      // this.path = "static/"+params+".pdf";
      // this.path = require("@/assets/src-pdf/"+params+".pdf")

      //本地路径1
      // this.path = "../../../static/"+params+".pdf";
      this.pdfSrc = "../../../static/"+params+".pdf";
      // this.pdfSrc = "'http://1.117.149.191:100/literature/"+params+".pdf',{withCredentials: false}";
      //路径2
      // this.path = "/Users/wanghong/IdeaProjects/testweb/static/"+params+".pdf";
    });
  },
  mounted() {
    var pdfName="";
    eventBus.$on("showDocFullScreen", params => {
      pdfName = params;
      //生产路径
      // this.path = "static/"+params+".pdf";
      // this.path = require("@/assets/src-pdf/"+params+".pdf")

      //本地路径1
      // this.path = "../../../static/"+params+".pdf";
      // this.pdfSrc = "http://1.117.149.191:100/literature/"+params+".pdf";

      //路径2
      // this.path = "/Users/wanghong/IdeaProjects/testweb/static/"+params+".pdf";
    });
    pdfName = this.$route.query.params;
    // this.pdfSrc = "../../../static/"+pdfName+".pdf";
    this.pdfSrc = "http://1.117.149.191:100/literature/"+pdfName+".pdf";
    this.id = this.$route.params.id || "";
    this.$refs.PreviewpdfH5.openPdf(this.pdfSrc);
    this.changeType(this.id);
  }
}
</script>

<style scoped>
.el-textarea__inner{
  font-family: "Microsoft YaHei";
  size: 1rem;
  font-size: 15px;
}
</style>
